Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

troika-three-text

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

troika-three-text

SDF-based text rendering for Three.js

  • 0.37.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
277K
decreased by-1.7%
Maintainers
1
Weekly downloads
 
Created

What is troika-three-text?

The troika-three-text npm package is a library for rendering high-quality, performant text in Three.js scenes. It provides a simple and flexible way to add 3D text to your WebGL applications, with support for advanced features like custom fonts, text layout, and text effects.

What are troika-three-text's main functionalities?

Basic Text Rendering

This feature allows you to render basic 3D text in a Three.js scene. You can set the text content, font size, and position.

const { Text } = require('troika-three-text');
const text = new Text();
text.text = 'Hello, World!';
text.fontSize = 1;
text.position.set(0, 0, 0);
scene.add(text);

Custom Fonts

This feature allows you to use custom fonts by specifying the URL to a font file. This can be useful for branding or stylistic purposes.

const { Text } = require('troika-three-text');
const text = new Text();
text.text = 'Custom Font';
text.font = 'https://example.com/path/to/font.woff';
text.fontSize = 1;
text.position.set(0, 0, 0);
scene.add(text);

Text Effects

This feature allows you to apply various effects to the text, such as changing the color or adding glow effects. This can enhance the visual appeal of the text in your scene.

const { Text } = require('troika-three-text');
const text = new Text();
text.text = 'Glowing Text';
text.fontSize = 1;
text.position.set(0, 0, 0);
text.material = new THREE.MeshBasicMaterial({ color: 0xff0000 });
scene.add(text);

Other packages similar to troika-three-text

FAQs

Package last updated on 18 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc